package com.example.stock.utils;

import android.content.Context;

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;


public class AsyncHttpUtils {
    public  static AsyncHttpClient client=new AsyncHttpClient();
    static {
        client.setTimeout(300000);
    }

    public static void get(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
        client.get(url, params, responseHandler);
    }

    public static void get(String url,AsyncHttpResponseHandler responseHandler){
        client.get(url,responseHandler);
    }

    public static void post(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
        client.post(url, params, responseHandler);
    }

    public static void cancelRequests(Context context){
    	client.cancelRequests(context, true);
    }

 }
